function api(url,data,func) {
    $.ajax({
        url: url,
        data: data,
        dataType: 'JSON',
        type: "POST",
        success: function (data) {
            debugger;
            if (data.code = '00000000') {
                func(data.data);
            } else {
                alert(data.msg);
            }

        }

    });
}

function medatc(url,data,func) {
    $.ajax({
        url: url,
        data: data,
        dataType: 'JSON',
        type: "POST",
        success: function (data) {
            func(data);
        }

    });
}

function getQueryString(name) {
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}